<template>
    <div>
        <el-button @click="open"
                 size="small"
              
              type="danger"
                   class="registerAdd"
        >删除</el-button>

  
    </div>
</template>

<script>
import {riskExcludeNewdelete} from '@/api/risk'
    export default {
         props: ['data'],
        data() {
            return {
               
            }
        },
     
        created() {
            console.log(this.data)
        },
        methods: {
            handleClose() {
                this.dialogVisible = false
                this.data = {}
            },

            open() {
              
               console.log( this.$props.data);
                this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
            riskExcludeNewdelete({id:this.$props.data.id})
          this.$message({
            type: 'success',
            message: '删除成功!'
          });
          this.reload()
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          });
          this.reload()          
        });
            }
        },

         inject: ['reload']

    }
</script>

<style lang="scss" scoped>
    .registerAdd {
        margin-left: 10px;
    }
</style>